package cn.faster.common.enums;

import lombok.Getter;

import java.io.Serializable;

@Getter
public enum EnumUserOperate implements Serializable {
    ADD("add", 0, "新增"),
    UPDATE("update", 1, "修改"),
    DELETE("delete", 2, "删除"),
    LOGOUT("loginOut",3,"退出登录");

    private final String name;
    private final Integer value;
    private final String desc;

    EnumUserOperate(String name, Integer value, String desc) {
        this.name = name;
        this.value = value;
        this.desc = desc;
    }

    public static EnumUserOperate getByValue(Integer value) {
        for (EnumUserOperate e : values()) {
            if (e.getValue().equals(value)) {
                return e;
            }
        }
        return null;
    }
}
